package com.asiainfo.complier.helper;

import java.util.ArrayList;

public class ArrayHelper {
	/**
	 * toArraySplit
	 * 
	 * @param list
	 * @return
	 */
	public static String toArraySplit(ArrayList<String> list) {
		int size = list.size();
		String dot = ";";
		String retStr = "";
		for (int i = 0; i < size; i++) {
			if (i == size - 1)
				dot = "";
			retStr += list.get(i) + dot;
		}
		return retStr;
	}

	/**
	 * StringToArrayBySplit
	 * 
	 * @param listStr
	 * @param split
	 * @return
	 */
	public static ArrayList<String> StringToArrayBySplit(String listStr,
			String split) {
		ArrayList<String> list = new ArrayList<String>();
		String[] arrLiStrings = listStr.split(split);
		for (int i = 0; i < arrLiStrings.length; i++) {
			list.add(arrLiStrings[i]);
		}
		return list;
	}

	private ArrayHelper() {
	}

}
